package com.hotel.auth.client;

import com.hotel.common.entity.Permission;
import com.hotel.common.entity.User;
import com.hotel.common.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(name = "hotel-user-service")
public interface UserClient {

    @GetMapping("/api/users/username/{username}")
    Result<User> getUserByUsername(@PathVariable("username") String username);

    @GetMapping("/api/permissions/user/{userId}")
    Result<List<Permission>> getPermissionsByUserId(@PathVariable("userId") Long userId);
}


